package agent;


public class State {
	private boolean cabadgeRight;
	private boolean cabadgeLeft;
	
	private boolean goatLeft;
	private boolean goatRight;
	
	private boolean wolfLeft;
	private boolean wolfRight;
	
	private BoatStates boatPassanger;
	
	private boolean boatRight;
	private boolean boatLeft;

	
	public State(boolean cabadgeRight, boolean cabadgeLeft, boolean goatLeft,
			boolean goatRight, boolean wolfLeft, boolean wolfRight,
			BoatStates boatPassanger, boolean boatRight, boolean boatLeft) {
		super();
		this.cabadgeRight = cabadgeRight;
		this.cabadgeLeft = cabadgeLeft;
		this.goatLeft = goatLeft;
		this.goatRight = goatRight;
		this.wolfLeft = wolfLeft;
		this.wolfRight = wolfRight;
		this.boatPassanger = boatPassanger;
		this.boatRight = boatRight;
		this.boatLeft = boatLeft;
	}

	public boolean equals(State s) {
		if (s.cabadgeLeft==cabadgeLeft &&
			s.cabadgeRight==cabadgeRight&&
			s.goatRight==goatRight&&
			s.goatLeft==goatLeft &&
			s.wolfLeft==wolfLeft &&
			s.wolfRight==wolfRight &&
			s.boatPassanger==boatPassanger)
			return true;
		return false;
	}

	public boolean isCabadgeLeft() {
		return cabadgeLeft;
	}

	public void setCabadgeLeft(boolean cabadgeLeft) {
		this.cabadgeLeft = cabadgeLeft;
	}

	public boolean isGoatLeft() {
		return goatLeft;
	}

	public void setGoatLeft(boolean goatLeft) {
		this.goatLeft = goatLeft;
	}

	public boolean isWolfLeft() {
		return wolfLeft;
	}

	public void setWolfLeft(boolean wolfLeft) {
		this.wolfLeft = wolfLeft;
	}
	
	public State dupe(){
		return new State(cabadgeRight, cabadgeLeft, goatLeft, goatRight, wolfLeft, wolfRight, boatPassanger,boatRight,boatLeft);
	}

	public boolean isGoatRight() {
		return goatRight;
	}

	public void setGoatRight(boolean goateRight) {
		this.goatRight = goateRight;
	}

	public boolean isWolfRight() {
		return wolfRight;
	}

	public void setWolfRight(boolean wolfRight) {
		this.wolfRight = wolfRight;
	}

	public BoatStates getBoatPassanger() {
		return boatPassanger;
	}

	public void setBoatPassanger(BoatStates boatPassanger) {
		this.boatPassanger = boatPassanger;
	}

	public boolean isCabadgeRight() {
		return cabadgeRight;
	}

	public void setCabadgeRight(boolean cabadgeRight) {
		this.cabadgeRight = cabadgeRight;
	}

	public boolean isBoatRight() {
		return boatRight;
	}

	public void setBoatRight(boolean boatRight) {
		this.boatRight = boatRight;
	}

	public boolean isBoatLeft() {
		return boatLeft;
	}

	public void setBoatLeft(boolean boatLeft) {
		this.boatLeft = boatLeft;
	}
	@Override
	public String toString() {
		String ret = "";
		
		if (cabadgeLeft)
			ret +="-C-";
		if (goatLeft)
			ret+="-G-";
		if (wolfLeft)
			ret+="-W-";
		if (boatLeft)
			ret+="--"+boatPassanger+"--"+"             ";
		else
			ret+="             "+"--"+boatPassanger+"--";
		if (cabadgeRight)
			ret +="-C-";
		if (goatRight)
			ret+="-G-";
		if (wolfRight)
			ret+="-W-";
		return ret;
		
	}
}
